<template>
  <div class="container container_book_list">
    <div class="book_list">
      <a class="book_item" >
        <div class="item_status">
          <div class="date">下单时间：2018.04.08</div>
          <div class="status">待使用</div>
        </div>
        <div class="figure">
          <img src="https://i.loli.net/2018/06/10/5b1d2c1b1a36b.png" alt="" class="pic" />
        </div>
        <div class="content">
          <div class="title">明孝陵+音乐台+灵谷寺+美龄宫 成人票 套票</div>
          <div class="price">
            06.02 16:00 前有效
          </div>
          <div class="checked_price">合计：3张</div>
        </div>
        <div class="action">
            <div class="btn_del">
              <div class="iconfont icon-zsclose"></div>
            </div>
        </div>
      </a>

      <a class="book_item" >
        <div class="item_status">
          <div class="date">下单时间：2018.04.08</div>
          <div class="status">待使用</div>
        </div>
        <div class="figure">
          <img src="https://i.loli.net/2018/06/10/5b1d2c1b1a36b.png" alt="" class="pic" />
        </div>
        <div class="content">
          <div class="title">明孝陵+音乐台+灵谷寺+美龄宫 成人票 套票</div>
          <div class="price">
            06.02 16:00 前有效
          </div>
          <div class="checked_price">合计：3张</div>
        </div>
        <div class="action">
            <div class="btn_del">
              <div class="iconfont icon-zsclose"></div>
            </div>
          <div class="btn_em orange">再次预约</div>
        </div>

      </a>
    </div>
  </div>
</template>

<script>
import fly from '@/utils/fly'

export default {
  data () {
    return {
      nav: [],
      activeIndex: '',
      listData: []
    }
  },
  computed: {},
  methods: {
    async activeNav (i) {
      if (this.activeIndex === i) {
        return
      }
      this.activeIndex = i
      let res = await fly.post('order/list')
      // if (res && res.code === 0 && res.data) {
      if (res && res.data) {
        this.listData = res.data
      } else {
        wx.showToast({
          title: '数据异常',
          icon: 'none'
        })
      }
    }
  },
  async onLoad () {
    wx.showLoading({
      title: '加载中'
    })
    let res = await fly.post('orderType/list')
    wx.hideLoading()
    // if (res && res.code === 0 && res.data) {
    if (res && res.data) {
      this.nav = res.data
      this.activeNav(0)
    } else {
      wx.showToast({
        title: '数据异常',
        icon: 'none'
      })
    }
  },
  onPullDownRefresh () {}
}
</script>

<style lang="scss">
  @import './book-list.scss';
</style>
